home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac Power 1997 December
/
MACPOWER-1997-12.ISO.7z
/
MACPOWER-1997-12.ISO
/
AMUG
/
PROGRAMMING
/
Raven 1.2 Examples.sit
/
Raven 1.2 Examples
/
Quill
/
Source
/
MacControlEditor.cpp
< prev
next >
Wrap
Text File
|
1997-05-11
|
4KB
|
129 lines
/*
* File: MacControlEditor.cpp
* Summary: A view that knows how to edit a TMacControl.
* Written by: Jesse Jones
*
* Copyright ゥ 1996 Jesse Jones.
* For conditions of distribution and use, see copyright notice in ZTypes.h
*
* Change History (most recent first):
*
* <-> 11/01/96 JDJ Created
*/
#include "MacControlEditor.h"
#include <ZTextBox.h>
#include "RsrcPopupMenu.h"
// ===================================================================================
// class CEditMacControlCommand
// ===================================================================================
//---------------------------------------------------------------
//
// CEditMacControlCommand::~CEditMacControlCommand
//
//---------------------------------------------------------------
CEditMacControlCommand::~CEditMacControlCommand()
{
}
//---------------------------------------------------------------
//
// CEditMacControlCommand::CEditMacControlCommand
//
//---------------------------------------------------------------
CEditMacControlCommand::CEditMacControlCommand(TMacControl* pane, const SMacControlInfo& oldInfo, const SMacControlInfo& newInfo) : Inherited(pane, oldInfo, newInfo)
{
}
//---------------------------------------------------------------
//
// CEditMacControlCommand::UpdatePane
//
//---------------------------------------------------------------
void CEditMacControlCommand::UpdatePane(const SMacControlInfo& info)
{
mPane->SetTitle(info.title);
mPane->SetTextTraits(info.traitsID);
}
#pragma mark -
// ===================================================================================
// CMacControlEditor
// ===================================================================================
static TReanimatorRegister<CMacControlEditor> sCaptionEditorRegistrar;
//---------------------------------------------------------------
//
// CMacControlEditor::~CMacControlEditor
//
//---------------------------------------------------------------
CMacControlEditor::~CMacControlEditor()
{
}
//---------------------------------------------------------------
//
// CMacControlEditor::CMacControlEditor
//
//---------------------------------------------------------------
CMacControlEditor::CMacControlEditor(TView* superView) : Inherited(superView)
{
}
//---------------------------------------------------------------
//
// CMacControlEditor::Create [static]
//
//---------------------------------------------------------------
MReanimatable* CMacControlEditor::Create(MReanimatable* parent)
{
return new CMacControlEditor(dynamic_cast<TView*>(parent));
}
//---------------------------------------------------------------
//
// CMacControlEditor::GetEditorInfo
//
//---------------------------------------------------------------
SMacControlInfo CMacControlEditor::GetEditorInfo() const
{
SMacControlInfo info;
TTextBox* textBox = dynamic_cast<TTextBox*>(this->FindSubPane("Control Title"));
info.title = textBox->GetText();
CRsrcPopupMenu* popup = dynamic_cast<CRsrcPopupMenu*>(this->FindSubPane("Traits ID"));
info.traitsID = popup->GetID();
return info;
}
//---------------------------------------------------------------
//
// CMacControlEditor::SetEditorInfo
//
//---------------------------------------------------------------
void CMacControlEditor::SetEditorInfo(const SMacControlInfo& info)
{
TTextBox* textBox = dynamic_cast<TTextBox*>(this->FindSubPane("Control Title"));
textBox->SetText(info.title);
CRsrcPopupMenu* popup = dynamic_cast<CRsrcPopupMenu*>(this->FindSubPane("Traits ID"));
popup->SetID(info.traitsID);
}